<#-- 分页（Pager对象、链接URL、最大页码显示数） -->
<#macro pager pager baseUrl   maxShowPageCount = 6>
  
  
      
      
      
      
	<#local pageNo = pager.pageNo />
	<#local totalCount = pager.totalCount />
	<#local pageCount = pager.pageCount />
	
	<#local firstPageUrl = baseUrl?replace(':pageNo',1) />
	<#local lastPageUrl = baseUrl?replace(':pageNo',pageCount) />
	<#local prePageUrl = baseUrl?replace(':pageNo',(pageNo - 1)) />
	<#local nextPageUrl = baseUrl?replace(':pageNo',(pageNo + 1)) />

	<#if maxShowPageCount <= 0>
		<#local maxShowPageCount = 6>
	</#if>
	
	<#local segment = ((pageNo - 1) / maxShowPageCount)?int + 1 />
	<#local startPageNo = (segment - 1) * maxShowPageCount + 1 />
	<#local endPageNo = segment * maxShowPageCount />
	<#if (startPageNo < 1)>
		<#local startPageNo = 1 />
	</#if>
	<#if (endPageNo > pageCount)>
		<#local endPageNo = pageCount />
	</#if>
   <script type="text/javascript">
   
   $(function(){
	   $("ul.dropdown-menu li").each(function(){
		   var $this = $(this);
		   $(this).click(function(){
			   var href = $(".J_mainContent div.J_box:visible").attr("data-id")+"?pageSize="+$this.find("a").html();
			   var o = layer.load();
				 $(".J_mainContent div.J_box:visible").html('<div class="loading">加载中,请稍等。。<div>');
				 $(".J_mainContent div.J_box:visible").loadUrl(href,'get',{},function(data) {
					layer.close(o);
					 $(".J_mainContent div.J_box:visible").find("div.loading").remove();
				}); 
		   });
		 
	   });
	   
	   
	   
	   
	   $("ul.pagination li").each(function(){
		   var $this = $(this);
		   $(this).click(function(){
		    if($this.hasClass("disabled") || $this.hasClass("active")){
		    	return !1;
		    }
		   var href = $this.find("a").attr("href");
		   var o = layer.load();
			 $(".J_mainContent div.J_box:visible").html('<div class="loading">加载中,请稍等。。<div>');
			 $(".J_mainContent div.J_box:visible").loadUrl(href,'get',{},function(data) {
				layer.close(o);
				 $(".J_mainContent div.J_box:visible").find("div.loading").remove();
			}); 
			 return !1;
		   });
	   });
   });
      
   </script>

<div class="fixed-table-pagination" style="display: block;">
	<div class="pull-left pagination-detail " style="margin-top:0px !important;">
		<span class="pagination-info">显示第 ${pager.startIndex}  到第 ${pager.endIndex}  条记录，总共 ${totalCount} 条记录</span><span
			class="page-list">每页显示 <span class="btn-group dropup"><button
					type="button" class="btn btn-default  dropdown-toggle"
					data-toggle="dropdown">
					<span class="page-size">${pager.pageSize!10}</span> <span class="caret"></span>
				</button>
				<ul class="dropdown-menu" role="menu">
					<li <#if (pager.pageSize!10 )==  10> class="active"</#if> ><a href="javascript:void(0)">10</a></li>
					<li  <#if  (pager.pageSize!10) ==  25> class="active"</#if> ><a href="javascript:void(0)">25</a></li>
					<li   <#if  (pager.pageSize!10) ==  50> class="active"</#if> ><a href="javascript:void(0)">50</a></li>
					<li   <#if  (pager.pageSize!10 )==  100> class="active"</#if> ><a href="javascript:void(0)">100</a></li>
					<li   <#if  (pager.pageSize!10 )==  200> class="active"</#if> ><a href="javascript:void(0)">200</a></li>
				</ul></span> 条记录
		</span>
	</div>
       <div class="  pagination" style="float:right">
		<ul class="pagination">   
       <#if (pageNo > 1)>
          <li class="page-first"><a href="${firstPageUrl}">«</a></li>
			<li class="page-pre"><a href="${prePageUrl}">‹</a></li>
   	  	<#else>
   	        <li class="page-first disabled"><a href="javascript:void(0)">«</a></li>
			<li class="page-pre disabled"><a href="javascript:void(0)">‹</a></li>
   	  </#if>
   	  <#list startPageNo .. endPageNo as index>
   		<#if index_index!=0>
   		</#if>
		<#if pageNo != index>
		 <li class="page-number"><a href="${baseUrl?replace(':pageNo',index)}">${index}</a></li>
		<#else>
		 <li class="page-number active"><a href="javascript:void(0)">${index}</a></li>
		</#if>
	  </#list>
   	  <#if (pageNo < pageCount)>
             <li class="page-next"><a href="${nextPageUrl}">›</a></li>
			 <li class="page-last"><a href="${lastPageUrl}">»</a></li>
   	<#else>
    	<li class="page-next disabled"><a href="javascript:void(0)">›</a></li>
			<li class="page-last disabled"><a href="javascript:void(0)">»</a></li>
	</#if>
	 	</ul>
	</div>
	 
</div>

</#macro>






